package com.netease.nie.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.netease.nie.base.utils.DateUtils;
import com.netease.nie.common.CommonService;
import com.netease.nie.dao.ExchangeGoodsInfoDao;
import com.netease.nie.dto.ExchangeGoodsInfoListDto;
import com.netease.nie.model.ExchangeGoodsInfo;

@Service
public class PrivilegeGoodsServiceImpl extends CommonService implements PrivilegeGoodsService {
	
	@Autowired
	private ExchangeGoodsInfoDao exchangeGoodsInfoDao;

	public List<ExchangeGoodsInfoListDto> queryGoodsInfoListByPrivilegeLevel(int level) {
		long currTimeMills = DateUtils.currentTimeInMills();
		List<ExchangeGoodsInfo> exchangeGoodsInfoList = exchangeGoodsInfoDao.queryGoodsInfoListByPrivilegeLevel(level);
		List<ExchangeGoodsInfoListDto> exchangeGoodsInfoListDtoList = generateGoodsInfoDtoList(exchangeGoodsInfoList, currTimeMills);
		return exchangeGoodsInfoListDtoList;
	}
}
